//初始化树结构（合并初始内容）
var baseUrl = "";
var token = sessionStorage.getItem("token");
VanyAjax.token = token;
VanyAjax.baseUrl = baseUrl;
var NodeSetting;
var setting3 = {
	data: {
		key: {
			name: "teamName"
		}
	}
};
if("undefined" == typeof setting2) {
	setting2 = '';
}
NodeSetting = $.extend({}, setting1, setting2, setting3);
new VanyBaseTree("#treeDemo", baseUrl + "/base/team/load?token=" + sessionStorage.token, NodeSetting);

//非通用功能
//头部标题新增按钮
addTreeTitle("#treeTitle");
//节点群组人员展示
var RoleList = RoleOrg("rolePerson", "authority/qxgl/json/loadTeamInfo.json");

//刷新表格
//function zTreeOnClick(treeNode) {
//	console.log("刷新权限管理")
//}

//树节点操作
var editTree = new Vue({
	el: '#rMenu',
	methods: {
		//编辑节点
		Edit: function() {
			hideRMenu();
			//获取树节点相关信息
			var treeKey = zTree.getSelectedNodes()[0];
			for(var key in treeKey) {
				treeEdit.ruleForm[key] = treeKey[key];
				if(key == "state") {
					zTree.getSelectedNodes()[0].state == 1 ? treeEdit.ruleForm[key] = 1 : treeEdit.ruleForm[key] = 0
				}
			}
			treeEdit.treeEditVisible = true;
		},
		//删除节点
		del: function() {
			hideRMenu();
			delNode(this);
		},
		//开启
		EnableUse: function() {
			EnableUse(this);
		},
		//禁用
		DisableUse: function() {
			DisableUse(this);
		},
		//批量操作
		AddPeople: function() {
			RoleList.getRolePerson();
		}
	}
});


//穿梭框
new Vue().$mount('#transfertabs');
transfer = new VanyTransfer("#transfer", "authority/qxgl/json/transfer.json");
// 42是选项卡高度，15是padding高度，2是边框高度
//var _treeHeight = $("#move_left").height() - 42 - 30 - 2;
transfer.setTreeHeight(645);